package org.asdtiang.study.springaop;

import java.lang.reflect.Method;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class Sleep {
	public Sleep(){}
	//execution(* set*(..))
	@Pointcut("execution (* sleep* (..))")// 
    public void sleeppoint(){}
	
	@Before("sleeppoint()")
	public void before(Method mtd, Object[] arg1, Object arg2) throws Throwable {
		System.out.println("通常情况下睡觉之前要脱衣服！");
	}
	@AfterReturning("sleeppoint()")
	public void afterReturning(Object arg0, Method arg1, Object[] arg2,
			Object arg3) throws Throwable {
		System.out.println("起床后要先穿衣服！");
	}

}
